<?php
/**
+++----视图模型 news与news_info
*/
class IndexViewModel extends ViewModel {
   
    public $viewFields = array(

		 'news'=>array('*' ,'_as'=>'n' ),
		
		 'news_info'=>array('*','_as'=>'ni','_on'=>'n.news_id=ni.news_id'),
		
		 );


  //獲取所有信息
   public function getAll($where,$limit,$order){
		return $this->where($where)->limit($limit)->order($order)->select();
	}
  //獲取一條信息
   public function getOne($where){
		return $this->where($where)->find();
	}
	
	

  
}

?>